HiBrad,
I have tried doing this using the KMViaVB.dll and have had some success using it from Python using Ctypes.
Following is working code:
#**************************************
# filename: calldll.py
# Make sure to include the Kmotion.dll and KMViaVB.dll in the same folder as this python file or that it is somewhere in your windows #path
#*************************************
import ctypes
import _ctypes;
# give location of dll
amitdll = ctypes.WinDLL("KMViaVB.dll")
hdl = ctypes.c_long(10)
print hdl
result = amitdll.KMViaVB_Test1()
print result
result = amitdll.KMViaVB_Test2(hdl)
print result
hdl.value = hdl.value +10
result = amitdll.KMViaVB_Test3(ctypes.byref(hdl))
print result
result = amitdll.KMViaVB_New(ctypes.byref(hdl))
print "km new" , result
result = amitdll.KMViaVB_WriteLine(hdl, "MoveRel0=100")
print "km move" , result
result = amitdll.KMViaVB_Free(ctypes.byref(hdl))
print "km_free", result
#*******************
run this using:
python calldll.py
This results in motion.
Now I will try using the coordinated motion library. Is there any thing like KMViaVB.dll for GcodeInterpreter.dll? Or will I have to make it?
Regards,
Amit Goradia, Ph.D.,
Automata Systems,
141 Veena Dalvai Indst. Est.,
S. V. Road, Jogeshwari (W),
Mumbai 400102. India.
Ph: +91 97696 84015
On Fri, Sep 14, 2012 at 6:43 PM, brad murry
<bradodarb@...> wrote:
I know in Linux there are many programs where c++objects are called from python, but I'm not sure how you would do it in windows.
The super easy route would be to install Iron Python and import the .net all. All objects would become immediately available.
-Brad Murry
From:
amitgoradia
Sent:
9/14/2012 12:15 AM
To:
DynoMotion@yahoogroups.com
Subject:
[DynoMotion] Calling KMotionDLL from a python program
Hi
New user for KFLOP card.
I want to call KmotionDLL and GcodeinterpreterDLL from a python program.
Python 2.7.
Is there an easy way to do this? Has someone done this before? Can someone point me int he right direction to get this going?
For python I would like to use Ctypes but any other method like CPython or Boost::Python is also OK.
Regards,
Amit Goradia